Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance API Reference - Documentation improvements #410

Merged
merged 6 commits into from
Oct 1, 2024

Conversation

gtsonevv
Copy link
Collaborator

@gtsonevv gtsonevv commented Sep 27, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

Related issues/PRs

Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -123,7 +123,7 @@ export class FungibleToken implements FungibleTokenCore, StorageManagement, Fung
// Get the unused amount from the `ft_on_transfer` call result.
let unused_amount: Balance;
try {
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returnes result with brackets?
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returns result with brackets?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FT standard defined the encoding for the input/outputs as JSON. Since JSON does not support big integers, the FT standard uses a string type to pass the unused_amount. It would be cleaner to use JSON.parse() instead of manually "parsing" quotes out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frol, this is out of this PR's scope, would be better in a separate PR

Comment on lines 21 to 29
* @call({})
* ft_on_transfer({ sender_id, amount, msg }: {
sender_id: AccountId;
amount: number;
msg: String;
}): PromiseOrValue<number> {
return this.token.ft_on_transfer({ sender_id, amount, msg });
};
* }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting is broken here, and in a few other places in the doc string examples. Please, fix them

Comment on lines 10 to 14
* import {
FungibleTokenCore,
FungibleTokenResolver,
FungibleToken,
* } from "near-contract-standards/lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting issue

@gtsonevv gtsonevv requested a review from frol October 1, 2024 07:29
Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@race-of-sloths score 5

@frol frol merged commit 1ec6634 into near:develop Oct 1, 2024
2 checks passed
@race-of-sloths
Copy link

race-of-sloths commented Oct 1, 2024

@gtsonevv Thank you for your contribution! Your pull request is now a part of the Race of Sloths!

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@frol 5

Your contribution is much appreciated with a final score of 5!
You have received 50 Sloth points for this contribution

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants